<template>
	<view class="listBody">
		<view class="list" v-for="(item,i) of weixiu" :key="i">
			<view class="title">
				{{item.chepai}}
			</view>
			<view class="ptTxt">
				<text>维修部位：</text>
				<text style="margin-left: 0.1rem;"> {{item.weixiubuwei}}</text>
			</view>
			<view class="tsTxt">
				<text>维修时间：</text>
				<text style="margin-left: 0.1rem;"> {{item.time}}</text>
			</view>
			<image :src="`http://localhost:8888/files/download/${item.img}`" class="image" mode=""></image>
			<view style="height: 1rem;"></view>
		</view>
	</view>
</template>

<script>
	import {
		weixiuList
	} from "@/request/API/xinwentongzhi/index";
	import uploadFile from '@/components/uploadFile.vue'
	export default {
		components: {
			uploadFile
		},
		data() {
			return {
				weixiu: []
			};
		},
		onLoad() {
			this.obj = uni.getStorageSync("user");
			this.xingming = this.obj.yonghuming
		},
		onShow() {
			this.weixiuList()
		},
		methods: {
			weixiuList() {
				weixiuList({
					xingming: this.obj.xingming
				}).then(res => {
					this.weixiu = res.data.list;
					console.log(this.weixiu)
				})
			}
		}
	}
</script>
<style lang="scss">
	.listBody {
		width: 100%;
		height: 100vh;
		overflow: hidden;
		background: #e2dddd;
	}

	.list {
		width: 95%;
		margin: 1rem auto;
		border-radius: 0.3rem;
		background: #ffffff;
		position: relative;

		.image {
			position: absolute;
			width: 270rpx;
			height: 90%;
			top: 5%;
			right: 10rpx;
		}

		.title {
			width: 32%;
			margin: 0.5rem 5%;
			height: 3rem;
			font-weight: 800;
			display: flex;
			align-items: center;
			justify-content: center;
			border-bottom: 0.1rem solid #c1b9b9;
		}

		.ptTxt {
			width: 90%;
			height: 2rem;
			margin: 0.5rem auto;
			display: flex;
			align-items: center;
		}

		.tsTxt {
			width: 90%;
			height: 2rem;
			margin: 0.5rem auto;
			display: flex;
			align-items: center;
			color: #ff573a;
		}
	}
</style>